﻿using Iesi.Collections.Generic;
using NHibernate;
using System;
using System.Linq;
using NHibernate.Linq;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;

namespace Romantics.Domain.Objects
{
    public class Country : NamedEntity
    {
        [Required(ErrorMessage = "URL: Обязательное поле")]
        [StringLength(200, ErrorMessage = "URL: Длина не должна превышать 200 символов")]
        public virtual string URL { get; set; }
        
        private ISet<Region> regions = new HashedSet<Region>();

        [JsonIgnore]
        public virtual ISet<Region> Regions
        {
            get { return regions; }
            set { regions = value; }
        }
    }
}
